package cn.iocoder.yudao.module.search.enums;

import cn.iocoder.yudao.framework.common.exception.ErrorCode;

/**
 * 搜索模块错误码枚举类
 *
 * 搜索模块，使用 1-020-000-000 段
 *
 * @author 芋道源码
 */
public interface ErrorCodeConstants {

    // ========== 搜索引擎相关 1-020-001-000 ==========
    ErrorCode SEARCH_ENGINE_NOT_FOUND = new ErrorCode(1_020_001_000, "搜索引擎不存在");
    ErrorCode SEARCH_ENGINE_CONFIG_ERROR = new ErrorCode(1_020_001_001, "搜索引擎配置错误");
    ErrorCode SEARCH_ENGINE_CONNECTION_ERROR = new ErrorCode(1_020_001_002, "搜索引擎连接失败");
    ErrorCode SEARCH_ENGINE_OPERATION_ERROR = new ErrorCode(1_020_001_003, "搜索引擎操作失败");

    // ========== 索引相关 1-020-002-000 ==========
    ErrorCode INDEX_NOT_EXISTS = new ErrorCode(1_020_002_000, "索引不存在");
    ErrorCode INDEX_ALREADY_EXISTS = new ErrorCode(1_020_002_001, "索引已存在");
    ErrorCode INDEX_CREATE_FAIL = new ErrorCode(1_020_002_002, "索引创建失败");
    ErrorCode INDEX_DELETE_FAIL = new ErrorCode(1_020_002_003, "索引删除失败");
    ErrorCode INDEX_UPDATE_FAIL = new ErrorCode(1_020_002_004, "索引更新失败");

    // ========== 文档相关 1-020-003-000 ==========
    ErrorCode DOCUMENT_NOT_EXISTS = new ErrorCode(1_020_003_000, "文档不存在");
    ErrorCode DOCUMENT_CREATE_FAIL = new ErrorCode(1_020_003_001, "文档创建失败");
    ErrorCode DOCUMENT_UPDATE_FAIL = new ErrorCode(1_020_003_002, "文档更新失败");
    ErrorCode DOCUMENT_DELETE_FAIL = new ErrorCode(1_020_003_003, "文档删除失败");
    ErrorCode DOCUMENT_BULK_FAIL = new ErrorCode(1_020_003_004, "文档批量操作失败");

    // ========== 搜索相关 1-020-004-000 ==========
    ErrorCode SEARCH_QUERY_INVALID = new ErrorCode(1_020_004_000, "搜索查询无效");
    ErrorCode SEARCH_EXECUTE_FAIL = new ErrorCode(1_020_004_001, "搜索执行失败");
    ErrorCode SEARCH_RESULT_PARSE_FAIL = new ErrorCode(1_020_004_002, "搜索结果解析失败");

}
